<template>
  <template v-if="isNotEmpty(historys) && isNotEmpty(businessId)">
    <div v-for="his in historys" class="flow-history-item-wrapper">
      <div class="flow-history-item-header">
        <div style="width: 350px; display: flex">
          <el-avatar size="small" icon="UserFilled"/>
          <el-text type="primary" style="margin-left: 10px">{{ his.realname }}</el-text>
          <el-text style="margin-left: 10px">{{ his.commentActionInfo }}</el-text>
          <el-text type="info" style="margin-left: 20px">{{ his.createTime }}</el-text>
        </div>

        <div style="flex: 1; text-align: right; padding-right: 20px">
          <el-text type="info">
            审批节点名称:
            {{ his.userTaskName }}
            <span v-show="his.notify">(知会)</span>
            <span v-show="his.fromCounterSign">(加签)</span>
          </el-text>
        </div>
      </div>

      <div class="flow-history-item-body">
        <el-text>
          <div v-html="his.comment"></div>
        </el-text>

        <div v-show="isNotEmpty(his.attachmentIds)">
          <el-divider style="margin-bottom: 10px" content-position="left">
            <el-text>附件区</el-text>
          </el-divider>

          <FUploader :enable="false"
                     :attachmentIds="his.attachmentIds"/>
        </div>
      </div>
    </div>
  </template>
</template>
<script setup>
import {isNotEmpty} from '@/utils/CommonUtils';
import FlowHistory from './FlowHistoryRender';
import {defineProps} from 'vue';
import FUploader from '@/components/FUploader/index.vue';

const props = defineProps({
  businessId: undefined
});
let {loading, historys} = FlowHistory(props);
</script>

